//
//  MaterCell.m
//  LastTemp
//
//  Created by dllo on 15/4/25.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "MaterCell.h"
#define WIDTH self.contentView.frame.size.width
#define HEIGHT self.contentView.frame.size.height
@implementation MaterCell
- (void)dealloc
{
    [_myView release];
    [_myImageView release];
    [_rightImageView release];
    [_topLabel release];
    [_nameLabel release];
    [super dealloc];
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.myView = [[UIView alloc] init];
        [self.contentView addSubview:self.myView];
        [_myView release];
        self.myView.backgroundColor = [UIColor colorWithRed:185 / 255.0 green:221 / 255.0 blue:244 / 255.0 alpha:1];
        self.myView.layer.cornerRadius = 10;
        
        self.myImageView = [[UIImageView alloc] init];
        [self.myView addSubview:self.myImageView];
        [_myImageView release];
        
        
        self.rightImageView = [[UIImageView alloc] init];
        [self.myView addSubview:self.rightImageView];
        [_rightImageView release];
        
        self.topLabel = [[UILabel alloc] init];
        [self.myView addSubview:self.topLabel];
        [_topLabel release];
        
        self.nameLabel = [[UILabel alloc] init];
        [self.myView addSubview:self.nameLabel];
        [_nameLabel release];
        self.nameLabel.font = [UIFont systemFontOfSize:14];
        
        
    }
    return self;
}


-(void)layoutSubviews
{
    [super layoutSubviews];
    self.myView.frame = CGRectMake(10, 5, WIDTH-20, HEIGHT-10);
    self.myImageView.frame = CGRectMake(20, 30, 20, 20);
    self.topLabel.frame = CGRectMake(50, 15, 200, 30);
    self.nameLabel.frame = CGRectMake(50, 55, 200, 30);
    
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
